<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //写一个函数，实现对数字数组的排序

        function giao(arguments) {
            var b = ''
            for (i = 0; i<=arguments.length; i++) {
                for (j = 0; j <=arguments.length-i-1;j++) {
                    if (arguments[j] >arguments[j+1]) {
                        var a = arguments[j]
                            arguments[j] = arguments[j+1]
                            arguments[j+1] = a
                    }
                    
                }
            }
            return arguments
        }
        console.log(giao([3,5,4,1,2]));
    </script>
</body>
</html>